from django.shortcuts import render
from .models import Usermessage
# Create your views here.
def getForm(request):
    #查询操作
    #AllMessage=Usermessage.objects.all()
    #AllMessage=Usermessage.objects.filter(address='sjz',name='test')
    #for message in AllMessage:
        #print(message.name)
    #增加操作
    #message=Usermessage()
    #message.name="范志霖"
    #message.email="9115553@qq.com"
    #message.address="上海"
    #message.message="你好"
    #message.save()
    #获取表单数据
    #if request.method=="POST":
        #name=request.POST.get("name")
        #email=request.POST.get("email")
        #address=request.POST.get("address")
        #message=request.POST.get("message")
        #AllMessage=Usermessage()
        #AllMessage.name=name
        #AllMessage.email=email
        #AllMessage.address=address
        #AllMessage.message=message
        #AllMessage.save()
    #删除操作
    #AllMessage=Usermessage.objects.filter(name='这是个测试')
    #AllMessage.delete()
    #改
    #?
    return render(request, 'formtest.html')